//
// Created by ziya on 22-9-8.
//

#ifndef ZIYA_ELF_READER_TYPES_H
#define ZIYA_ELF_READER_TYPES_H

#include "../common.h"

#define Elf32_Addr u_int32_t
#define Elf32_Half u_int16_t
#define Elf32_Off u_int32_t
#define Elf32_Sword u_int32_t
#define Elf32_Word int32_t

#define Elf64_Addr u_int64_t
#define Elf64_Half u_int16_t
#define Elf64_Off u_int64_t
#define Elf64_Xword u_int64_t
#define Elf64_Sword u_int32_t
#define Elf64_Word int32_t

#define EI_CLASS    4       /* File class byte index */
#define ELFCLASSNONE    0   /* Invalid class */
#define ELFCLASS32  1       /* 32-bit objects */
#define ELFCLASS64  2       /* 64-bit objects */
#define ELFCLASSNUM 3

#define EI_DATA     5       /* Data encoding byte index */
#define ELFDATANONE 0       /* Invalid data encoding */
#define ELFDATA2LSB 1       /* 2's complement, little endian */
#define ELFDATA2MSB 2       /* 2's complement, big endian */
#define ELFDATANUM  3

#define EI_OSABI            7   /* OS ABI identification */
#define ELFOSABI_NONE       0   /* UNIX System V ABI */
#define ELFOSABI_SYSV       0   /* Alias.  */
#define ELFOSABI_HPUX       1   /* HP-UX */
#define ELFOSABI_NETBSD     2   /* NetBSD.  */
#define ELFOSABI_LINUX      3   /* Linux.  */
#define ELFOSABI_SOLARIS    6   /* Sun Solaris.  */
#define ELFOSABI_AIX        7   /* IBM AIX.  */
#define ELFOSABI_IRIX       8   /* SGI Irix.  */
#define ELFOSABI_FREEBSD    9   /* FreeBSD.  */
#define ELFOSABI_TRU64      10  /* Compaq TRU64 UNIX.  */
#define ELFOSABI_MODESTO    11  /* Novell Modesto.  */
#define ELFOSABI_OPENBSD    12  /* OpenBSD.  */
#define ELFOSABI_ARM_AEABI  64  /* ARM EABI */
#define ELFOSABI_ARM        97  /* ARM */
#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */

#endif //ZIYA_ELF_READER_TYPES_H
